]> dgit.raspbian.org Git - ostree.git/commitdiff
trivial-httpd: Fix const-correctness of slash pointer
authorKhem Raj <khem.raj@oss.qualcomm.com>
Thu, 9 Apr 2026 23:28:07 +0000 (16:28 -0700)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 24 Jun 2026 14:15:13 +0000 (10:15 -0400)
strrchr() returns a 'const char *' when passed a 'const char *'
argument. Declare the local 'slash' variable as 'const char *'
to match, fixing a build failure with clang when
-Werror,-Wincompatible-pointer-types-discards-qualifiers is active.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
src/ostree/ostree-trivial-httpd.c

index 4a0c6b0017ad2ddcbadda0c12499110008e50155..b5a52e611c613939a996b5057cbf57f02cf07ae8 100644 (file)
@@ -281,7 +281,7 @@ do_get (OtTrivialHttpd *self, SoupServer *server, SoupServerMessage *msg, const
 do_get (OtTrivialHttpd *self, SoupServer *server, SoupServerMessage *msg, const char *path)
 #endif
 {
-  char *slash;
+  const char *slash;
   int ret;
   struct stat stbuf;